<template>
	<div class="star_detail_wrapper">
		<h2>
			阅读之星：{{ starData.title }}
			<span>{{ starData.subTitle }}</span>
		</h2>
		<div class="content" v-html="starData.content"></div>
	</div>
</template>

<script>
import { mapActions } from 'vuex';
export default {
	data() {
		return {
			starData: {}
		};
	},
	computed: {
		starId() {
			return this.$route.params.id;
		}
	},
	mounted() {
		this.getStarDetail();
	},
	methods: {
		...mapActions(['getNewsDetail']),

		//获取阅读之星详情
		getStarDetail() {
			this.getNewsDetail(this.starId).then(res => {
				this.starData = { ...res };
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.star_detail_wrapper {
	padding-bottom: 64px;
	h2 {
		font-size: 24px;
		font-weight: normal;
		text-align: center;
		span {
			font-size: 16px;
			color: #999;
		}
	}
	.content {
		margin-top: 40px;
		font-size: 16px;
		line-height: 2;
		text-indent: 2em;
		color: #666;
	}
}
</style>
